package com.yikes.yygh.config;

import lombok.Data;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

/**
 * <p>
 *  minio配置文件
 * </p>
 *
 * @Author: guanrong.yin
 * @Date: 2024/12/10 23:29
 */
@Data
@Configuration
@ConfigurationProperties(prefix = "minio")
public class FileProperties implements InitializingBean {

    /**
     * MinIO的API地址
     */
    private String endpoint;

    /**
     * 用户名
     */
    private String accessKey;

    /**
     * 密钥
     */
    private String secretKey;

    /**
     * 存储桶名称
     */
    private String bucketName;

    /**
     * 自定义域名
     */
    private String customDomain;


    public static String END_POINT;

    public static String ACCESS_KEY;

    public static String SECRET_KEY;

    public static String BUCKET_NAME;

    public static String CUSTOM_DOMAIN;


    @Override
    public void afterPropertiesSet() {

        END_POINT = endpoint;
        ACCESS_KEY = accessKey;
        SECRET_KEY = secretKey;
        BUCKET_NAME = bucketName;
        CUSTOM_DOMAIN = customDomain;
    }

}
